package com.ruoyi.project.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.business.domain.BusinessArea;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.mapper.BusinessAreaOrderMapper;
import com.ruoyi.project.business.domain.BusinessAreaOrder;
import com.ruoyi.project.business.service.IBusinessAreaOrderService;

/**
 * 租地订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-19
 */
@Service
public class BusinessAreaOrderServiceImpl implements IBusinessAreaOrderService 
{
    @Autowired
    private BusinessAreaOrderMapper businessAreaOrderMapper;

    /**
     * 查询租地订单
     * 
     * @param id 租地订单ID
     * @return 租地订单
     */
    @Override
    public BusinessAreaOrder selectBusinessAreaOrderById(Long id)
    {
        return businessAreaOrderMapper.selectBusinessAreaOrderById(id);
    }

    /**
     * 查询租地订单列表
     * 
     * @param businessAreaOrder 租地订单
     * @return 租地订单
     */
    @Override
    public List<BusinessAreaOrder> selectBusinessAreaOrderList(BusinessAreaOrder businessAreaOrder)
    {
        return businessAreaOrderMapper.selectBusinessAreaOrderList(businessAreaOrder);
    }

    /**
     * 新增租地订单
     * 
     * @param businessAreaOrder 租地订单
     * @return 结果
     */
    @Override
    public int insertBusinessAreaOrder(BusinessAreaOrder businessAreaOrder)
    {
        businessAreaOrder.setCreateTime(DateUtils.getNowDate());
        return businessAreaOrderMapper.insertBusinessAreaOrder(businessAreaOrder);
    }

    /**
     * 修改租地订单
     * 
     * @param businessAreaOrder 租地订单
     * @return 结果
     */
    @Override
    public int updateBusinessAreaOrder(BusinessAreaOrder businessAreaOrder)
    {
        businessAreaOrder.setUpdateTime(DateUtils.getNowDate());
        return businessAreaOrderMapper.updateBusinessAreaOrder(businessAreaOrder);
    }

    /**
     * 批量删除租地订单
     * 
     * @param ids 需要删除的租地订单ID
     * @return 结果
     */
    @Override
    public int deleteBusinessAreaOrderByIds(Long[] ids)
    {
        return businessAreaOrderMapper.deleteBusinessAreaOrderByIds(ids);
    }

    /**
     * 删除租地订单信息
     * 
     * @param id 租地订单ID
     * @return 结果
     */
    @Override
    public int deleteBusinessAreaOrderById(Long id)
    {
        return businessAreaOrderMapper.deleteBusinessAreaOrderById(id);
    }

    /**
     * 查询被租的地
     * @param businessAreaOrder
     * @return
     */
    @Override
    public List<BusinessArea> areaList(BusinessAreaOrder businessAreaOrder) {
        return businessAreaOrderMapper.areaList(businessAreaOrder);
    }
}
